﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FireLinkStatusPanel.aspx.cs"
    Inherits="MTRC.ODMS.Web.SOM.FireProtection.FireLinkStatusPanel" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %>
<%@ Register Src="~/UserControl/Menu/PageFoot.ascx" TagName="PageFoot" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/TabStrip.ascx" TagName="TabStrip" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/PageHead.ascx" TagName="PageHead" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="WebStructure" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Operational Data Management System</title>
    <link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />
    <style type="text/css">
        /*Add by gordon 20150722 U128*/
        .ColorIndicator
        {
            font-weight: bold; padding:2px,2px,2px,2px; text-align: center;
            }
    </style>
    <script type="text/javascript" language="javascript">
        function DisplayHideColumn(objChk, strTableID) {
            var objColumn = document.getElementById(strTableID);
            var objColumntd = document.getElementById("td" + strTableID);

            if (objChk.checked) {
                objColumn.style.display = "block";
                objColumntd.style.display = "block";

            }
            else {
                objColumn.style.display = "none";
                objColumntd.style.display = "none";
            }

            //------ Issue U28:Add By Gordon 2015/05/28
            var container = document.getElementById("pnlLines");
            if (container.offsetHeight > 0 && (container.scrollWidth > container.clientWidth || container.offsetWidth > container.clientWidth)) {
                container.style.paddingBottom = "15px";
            } else {
                container.style.paddingBottom = "0px";
            }
            //-----------------------------------------
        }

        function SettingAfterDisplay() {
            var container = document.getElementById("pnlLines");
            if (container.offsetHeight > 0 && (container.scrollWidth > container.clientWidth || container.offsetWidth > container.clientWidth)) {
                container.style.paddingBottom = "15px";
            } else {
                container.style.paddingBottom = "0px";
            }
        }

        function InitHideTable() {
            var objInitHideTableValue = document.getElementById("hdnOnInitHideTableValue").value;
            objInitHideTableValue = objInitHideTableValue.substring(1, objInitHideTableValue.length);
            var objArray = objInitHideTableValue.split(",");
            for (var i = 0; i < objArray.length; i++) {
                //                var objOneTableID = objArray[i];
                //                var objColumn   =   document.getElementById(objOneTableID);
                //                objColumn.style.display = "none";
                eval(objArray[i] + ".style.display = 'none'");
            }
        }

        //------- Issue U28: Add By Gordon 2015/05/28
        window.onload = function () {
            var menu = document.getElementById("Menu_HeightKeeper");
            var menuClick = menu.previousSibling;
            //CloseMenu()
            menuClick.onclick = function () {
                ExtendMenuClick();
            }

            InitContainer();

            //Add By Gordon 20150624 | Ref To Req13.2
            InitRowCount();

            SettingAfterDisplay();
        }

        //add by gordon 20150817
        window.onresize = function () {
            InitContainer();
            SettingAfterDisplay();
        }

        //Add By Gordon 20150624 | Ref To Req13.2
        //Init Panel Display Row Count
        function InitRowCount() {
            var rowCount = 14;
            var windowHeight = screen.height;
            if (windowHeight < 900) {
                rowCount = 9;
            } else if (windowHeight < 1024) {
                rowCount = 10;
            } else if (windowHeight > 1024) {
                rowCount = 15;
            }

            if (document.getElementById("hdnRowCount").value != rowCount) {
                document.getElementById("hdnRowCount").value = rowCount;
                document.getElementById("btnRefresh").click();
            };
        }

        function InitContainer() {
            //update by gordon 20150817
            //var width = document.getElementById("pnlLines").offsetWidth;
            var menuWidth = document.getElementById("mainMenu").offsetWidth;
            //            document.getElementById("pnlLines").style.width = width;
            var width = document.body.clientWidth - menuWidth - 35;
            document.getElementById("pnlLines").style.width = width < 0 ? 0 : width;
        }

        function ExtendMenuClick() {
            var menuWidth = document.getElementById("mainMenu").offsetWidth;
            if (menuWidth > 0) {
                var width = document.getElementById("pnlLines").offsetWidth;
                document.getElementById("pnlLines").style.width = menuWidth + width;
                CloseMenu();
            } else {
                CloseMenu();
                var width = document.getElementById("pnlLines").offsetWidth;
                menuWidth = document.getElementById("mainMenu").offsetWidth;
                document.getElementById("pnlLines").style.width = width - menuWidth;
            }
        }
        //--------------------------------------------


    </script>
</head>
<body>
    <form id="form1" runat="server">
    <AjaxControlToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server">
    </AjaxControlToolkit:ToolkitScriptManager>
    <table border="0" cellpadding="0" cellspacing="0" class="Page_Container">
        <tr>
            <td colspan="2" class="Page_Head">
                <WebStructure:PageHead ID="PageHead" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="Page_Left">
                <WebStructure:MainMenu ID="MainMenu" runat="server" AppPath="../../" CurrMenuID="M1403" />
            </td>
            <td class="Page_Right" id="IdContainer">
                <table class="Page_Contents">
                    <tr>
                        <td class="TabStrip">
                            <WebStructure:TabStrip ID="TabStrip" CurrMenuID="M140304" ParentMenuID="M1403" DMenuMode="CurrOnly"
                                runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="Contents" style="height: 16px;">
                            <!-- Contents: put your content here-->
                            <asp:HiddenField ID="hdnRowCount" Value="14" runat="server" />
                            <fieldset style="clear: both; margin-bottom: 0px">
                                <legend class="title1">
                                    <asp:Label runat="server" ID="lblFireGroupStatus"></asp:Label></legend>
                                <%-- Issue U28: update by gordon 2015/05/28 --%>
                                <%--<table border="0" cellpadding="0" cellspacing="0" width="100%" >
						                <tr>
						                    <td>
                                                <table cellpadding="0" cellspacing="0" width="780px" style="border-width:0px; border-color:Black; border-style:solid;">
                                                    <tr>
                                                        <td align="right" colspan="2">
                                                            <asp:Button id="btnSaveSearchCriteria" runat="server" OnClick="btnSaveSearchCriteria_Click" />
                                                            <span><asp:Label ID="lblColorindicator" runat="server"></asp:Label></span><span>:</span>
                                                            <span style="font-weight:bold;"><asp:Label ID="lblNormal" runat="server"></asp:Label></span><span>,</span>
                                                            <span style="font-weight:bold;color:Red" ><asp:Label ID="lblOOS" runat="server"></asp:Label></span><span>,</span>
                                                            <span style="font-weight:bold;color:Fuchsia" ><asp:Label ID="lblVRT" runat="server"></asp:Label></span>
                                                            <span style="font-weight:bold;color:#FFCC33" ><asp:Label ID="lblTest" runat="server"></asp:Label></span>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                             <asp:CheckBoxList id="chklShow" runat="server" repeatDirection="horizontal" CssClass="tableborder"></asp:CheckBoxList>					                                                                    
                                                        </td>
                                                        <td>
                                                            <asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" />
                                                            <asp:Label ID="lblLastRefreshTime" runat="server" Text="" Visible="false"></asp:Label>
                                                        </td>                                                        
                                                    </tr>
                                                </table>
						                    </td>
						                </tr>
						                <tr>
						                    <td>
                                                <table cellpadding="0" cellspacing="0" width="100%" style="border-width:0px; border-color:Black; border-style:solid;">
                                                    <tr>
                                                        <td align="left" valign="top">
                                                            <asp:Panel ID="pnlLines" runat="server" ></asp:Panel>								                                                        
                                                        </td>
                                                    </tr>
                                                </table>
						                    </td>
						                </tr>
						            </table>--%>

                                    <asp:UpdatePanel ID="updFireLink" runat="server">
                                    <ContentTemplate>

                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <asp:CheckBoxList ID="chklShow" runat="server" RepeatDirection="horizontal" Style="display: inline"
                                                CssClass="tableborder">
                                            </asp:CheckBoxList>
                                            <div style="display: inline; vertical-align: top; margin-left: 5px">
                                                <asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" />
                                                <asp:Label ID="lblLastRefreshTime" runat="server" Text="" Visible="false"></asp:Label>
                                                <asp:Button ID="btnSaveSearchCriteria" runat="server" OnClick="btnSaveSearchCriteria_Click" />
                                                <%-- delete by gordon 20150722 U128 --%>
                                                <%--<span>
                                                    <asp:Label ID="lblColorindicator" runat="server"></asp:Label></span><span>:</span>
                                                <span style="font-weight: bold;">
                                                    <asp:Label ID="lblNormal" runat="server"></asp:Label></span><span>,</span> <span
                                                        style="font-weight: bold;">
                                                        <asp:Label ID="lblOOS" runat="server"></asp:Label></span><span>,</span>
                                                <span style="font-weight: bold;">
                                                    <asp:Label ID="lblVRT" runat="server"></asp:Label><asp:Label ID="lblComma" runat="server">,</asp:Label>
                                                </span>
                                                     <span style="font-weight: bold;
                                                        ">
                                                        <asp:Label ID="lblTest" runat="server"></asp:Label></span>--%>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                <asp:Panel ID="pnlLines" runat="server" Style="overflow-x: auto;">
                                </asp:Panel>
                                    
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="TimerRefresh" />
                                    </Triggers>
                                </asp:UpdatePanel>
                                
                                <%-- add by gordon 20150722 U128 --%>
                                <div style="margin-top: 10px; margin-bottom: 10px">
                                    <span>
                                        <asp:Label ID="lblColorindicator" runat="server"></asp:Label></span><span>:</span>
                                    <asp:Label ID="lblContainerNormal" runat="server" CssClass="ColorIndicator">
                                        <asp:Label ID="lblNormal" runat="server"></asp:Label></asp:Label><span style="font-weight: bold;">,</span><asp:Label
                                            ID="lblContainerOOS" runat="server" CssClass="ColorIndicator">
                                            <asp:Label ID="lblOOS" runat="server"></asp:Label></asp:Label><span style="font-weight: bold;">,</span><asp:Label
                                                ID="lblContainerVRT" runat="server" CssClass="ColorIndicator">
                                                <asp:Label ID="lblVRT" runat="server"></asp:Label></asp:Label><asp:Label ID="lblComma"
                                                    Font-Bold="true" runat="server">,</asp:Label><asp:Label ID="lblContainerTest" runat="server"
                                                        CssClass="ColorIndicator">
                                                        <asp:Label ID="lblTest" runat="server"></asp:Label></asp:Label>
                                </div>
                                <%-- -------------------------------------- --%>
                            </fieldset>
                            <!-- Contents-->
                        </td>
                    </tr>
                    <tr>
                        <%--<td class="Page_Foot" style="height: 54px"><WebStructure:PageFoot ID="PageFoot" runat="server" /></td>--%>
                        <td class="Page_Foot">
                            <WebStructure:PageFoot ID="PageFoot1" runat="server" />
                        </td>
                    </tr>
                </table>
                <asp:HiddenField ID="hdnOnInitHideTableValue" runat="server" />
                <asp:Timer ID="TimerRefresh" runat="server" OnTick="TimerRefresh_Tick">
                </asp:Timer>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
